package com.atguigu.realtime.function;

import com.atguigu.realtime.bean.KeywordRow;
import org.apache.flink.table.functions.TableFunction;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/12/3 14:32
 */
public class KeyWordProduct extends TableFunction<KeywordRow> {
    public void eval(Long click_ct, Long order_ct, Long cart_ct) {
        if (click_ct > 0) {
            collect(new KeywordRow("click", click_ct));
        }
        if (order_ct > 0) {
            collect(new KeywordRow("order", order_ct));
        }
        if (cart_ct > 0) {
            collect(new KeywordRow("cart", cart_ct));
        }
        
    }
}
